Blocking signature detection for identification of JPEG images

ABSTRACT

A method detects if an image is compressed. The method determines a block grid within the image and establishes blocks from the determined grid. The method then computes differences between samples inside the established blocks and differences between samples across the established blocks. The method determines that the image is compressed based on characteristics derived from statistics of the computed differences.

FIELD OF THE PRESENT INVENTION

[0001] The present invention is directed to a method of detecting imagescompressed in accordance with the conventional JPEG image compressionstandard, and more particularly, a method of detection a blockingsignature in an image to provide identification of a JPEG compressedimage.

BACKGROUND OF THE PRESENT INVENTION

[0002] Data compression is required in data handling processes, wheretoo much data is present for practical applications using the data.Commonly, compression is used in communication links, where the time totransmit is long, or where bandwidth is limited. Another use forcompression is in data storage, where the amount of media space on whichthe data is stored can be substantially reduced with compression. Adevice showing either or both of these cases is a digital copier wherean intermediate storage is used for collation, reprint or any otherdigital copier functions. Additionally, digital copiers often allow theprinting of externally received data. Generally speaking, scanned imagesand print masters, i.e., electronic representations of hard copydocuments, are commonly large, and thus are desirable candidates forcompression.

[0003] The method disseminated by the JPEG committee for still imagecompression is described in detail in “JPEG: Still Image CompressionStandard”, by W. Pennebaker and J. Mitchell, published by Van NostrandReinhold in 1992. We will refer to the lossy compression modes based onthe discrete cosine transform and it will be called JPEG compression inthis application. JPEG compression is a lossy system that reduces dataredundancies based on pixel to pixel correlations. Generally, in images,on a pixel to pixel basis, an image does not change very much. An imagetherefore has what is known as “natural spatial correlation”. In naturalscenes, correlation is generalized, but not exact. Noise makes eachpixel somewhat different from its neighbors.

[0004] Generally, as shown in FIG. 1, a JPEG compression anddecompression system is illustrated. A more complete discussion may behad by referencing U.S. Pat. No. 5,321,522 to Eschbach and U.S. Pat. No.5,359,676 to Fan. The entire contents of U.S. Pat. No. 5,321,522 andU.S. Pat. No. 5,359,676 are hereby incorporated by reference.

[0005] Initially provided is tile memory 10 for storing an M×M portionof the image. From the portion of the image stored in tile memory, thediscrete cosine transform (DCT), transformer 12 forms a frequency spacerepresentation of the image. Hardware implementations are available,such as the C-Cube Microsystems CL550A JPEG image compression processor,which operates in either the compression or the decompression modeaccording to the proposed JPEG standard. As will be described below, theimplementation of the invention can be in either in software orhardware.

[0006] A divisor/quantization device 14 is used, from a set of valuesreferred to as a Q-Table, stored in a Q table memory 16, so that adistinct Q table value is divided into the DCT value, returning theinteger portion of the value as the quantized DCT value. A statisticalencoder 20 often using Huffman codes is used to endcode the quantizedDCT values to generate the compressed image that is output for storage,transmission, etc.

[0007] Discrete cosine transforms are well known, and hardware exists toperform the transform on image data, e.g., U.S. Pat. No. 5,049,991 toNiihara, U.S. Pat. No. 5,001,559 to Gonzales et al., and U.S. Pat. No.4,999,705 to Puri.

[0008] To decompress the now-compressed image, and with reference toFIG. 1, a series of functions or steps are followed to reverse theprocess described. Huffman encoding is removed at decoder 50. The imagesignal now represents the quantized DCT coefficients, which aremultiplied at signal multiplier 52 by the Q table values in memory 54 ina process inverse to the compression process. At inverse transformer 56,the inverse transform of the discrete cosine transform is derived, andthe output image in the spatial domain is stored at image buffer 58.

[0009] In U.S. Pat. No. 5,321,522 and U.S. Pat. No. 5,379,122 toEschbach, U.S. Pat. No. 5,359,676 to Fan, the standard process describedin FIG. 1 is varied. The original image is compressed; the compressedrepresentation is decompressed. The decompressed image is additionallyfiltered to improve appearance, but in doing so, it may be forcedoutside the range of images that are possibly derived from the originalimage. The DCT representation of the image is therefore altered, inorder to force the image into the acceptable range of images. Theprocesses may be used iteratively.

[0010] Some image formats that involve compression such those using JPEGinflict degradation to the image. When a system invokes to print one ofthese compressed images, the incoming image may receive specialprocessing to remove those artifacts. First, however, one has todetermine whether the image was compressed beforehand.

[0011] The present invention proposes a method to identify whether theimage was compressed in the past. Moreover, the present inventionproposes a method to identify whether the image was JPEG compressed inthe past. By enabling identification of compressed images, the presentinvention will enable the printing system to steer a compressed imagetowards a cleaning image processing operation, thereby enabling theprinting system to clean-up the image from any undesirable artifacts.

[0012] The method of the present invention is based on the analysis ofsubtle blocking discontinuities that are present and readily discerniblein compressed images. For example in producing JPEG compressed images,the image is divided into blocks that are transformed, quantized, andcompressed virtually independently. Thus, discontinuities across blockboundaries (blocking effects) account for the most noticeablecompression artifact caused by JPEG compression. The higher thecompression the higher the blocking. The present invention performs ananalysis of the blocking discontinuities as an indicative of compressionhistory.

SUMMARY OF THE PRESENT INVENTION

[0013] One aspect of the present invention is a method for detecting ifan image is compressed. The method computes the absolute differencebetween two neighbor pixels of an image, for a predetermined number ofpixels of the image, horizontally and vertically; divides the resultsinto first differences that correspond to crossing block boundaries (I)and second differences that correspond to not crossing block boundaries(II); computes histograms from samples in I and II; normalizes eachhistogram; and determines if the image is compressed based on adifference between the two normalized histograms.

[0014] A second aspect of the present invention is a method fordetecting if an image is compressed. The method determines a block gridwithin the image; establishes blocks from the determined grid; computesdifferences between samples inside the established blocks; computesdifferences between samples across the established blocks; anddetermines that the image is compressed based on characteristics derivedfrom statistics of the computed differences.

[0015] A third aspect of the present invention is a method ofdetermining if an image is compressed. The method determines a blockgrid within the image; establishes blocks from the determined grid; foreach block, computes a first set of differences from four adjacentpixels located within the block; for each block, computes a second setof differences from four adjacent pixels, each pixel being located in acorner of four adjacent blocks; computes histogram H(n) for the firstset of differences and histogram H′(n) for the second set ofdifferences; normalizes the histograms; and determines if the image iscompressed based on a difference between the two normalized histograms.

[0016] A fourth aspect of the present invention is a method ofdetermining if an image is compressed. The method determines a blockgrid within the image; establishes blocks from the determined grid; foreach block, computes a first set of differences from a first set of fouradjacent pixels located within the block; for each block, computes asecond set of differences from a second set of four adjacent pixelslocated within the block; for each block, computes a third set ofdifferences from a third set of four adjacent pixels, each pixel in thethird set being located in a corner of four adjacent blocks; computeshistogram H₀(n) for the first set of differences, histogram, histogramH₁(n) for the second set of differences, and histogram H′(n) for thethird set of differences; normalizes the histograms; and determines ifthe image is compressed based on a difference between the threenormalized histograms.

[0017] A fifth aspect of the present invention is a method fordetermining a grid within an image. The method computes a first sum ofabsolute values of the differences in a horizontal direction comprisingonly samples which are a predetermined number of pixels apart; computesa second sum of absolute values of the differences in a verticaldirection comprising only samples which are the predetermined number ofpixels apart; and determines if the image contains a grid based on arelationship between the first and second sums and a predeterminedthreshold.

[0018] A sixth aspect of the present invention is a method fordetermining a grid location within an image. Let P(i,j) be the lightintensity of image pixels at position (i,j) in the image. The methodcomputes a first sum EH of absolute values of the differences in ahorizontal direction comprising only samples that are a predeterminednumber of pixels R apart wherein${E_{H} = {\sum\limits_{i}{\sum\limits_{j}^{\quad}{{{P\left( {i,{{Rj} + D_{H}}} \right)} - {P\left( {i,{{Rj} + D_{H} - 1}} \right)}}}}}};$

[0019] computes a second sum E_(V) of absolute values of the differencesin a vertical direction comprising only samples which are apredetermined number of pixels R apart wherein${E_{V} = {\sum\limits_{i}^{\quad}{\sum\limits_{j}^{\quad}{{{P\left( {{{Ri} + D_{V}},j} \right)} - {P\left( {{{Ri} + D_{V} - 1},j} \right)}}}}}};$

[0020] determines if the image contains a grid based on a relationshipbetween the first and second sums and a predetermined threshold; andlocates a boundary in the R-pixel-spaced grid as a point verticallyshifted by D_(V) pixels from an origin and horizontally shifted by DHpixels from the origin, wherein D_(V) and D_(H) are values whichmaximize E_(V) and E_(H), respectively.

[0021] Another aspect of the present invention is a method for detectingif an image is compressed. The method computes the absolute differencebetween two neighbor pixels of an image, for a predetermined number ofpixels of the image, horizontally and vertically; divides the resultsinto first differences that correspond to crossing block boundaries (I)and second differences that correspond to not crossing block boundaries(II); and determines if the image is compressed based on a differencebetween statistics of the first and second difference sequences.

[0022] A further aspect of the present invention is a method to detectif an image is compressed. The method detects blocking artifacts in theimage indicative of compression and provides an output indicative ofcompression upon detection of the blocking artifacts.

[0023] Further objects and advantages of the present invention willbecome apparent from the following description and the various featuresof the present invention.

BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The following is a brief description of each drawing used todescribe the present invention, and thus, are being presented forillustrative purposes only and should not be limitative of the scope ofthe present invention, wherein:

[0025]FIG. 1 shows a functional block diagram for the prior art ADCTcompression/recompression process;

[0026]FIG. 2 shows a typical application for the proposed embodiment;

[0027]FIG. 3 is a flowchart showing one embodiment of the presentinvention;

[0028]FIG. 4 illustrates normalized histograms for an uncompressedimage;

[0029]FIG. 5 illustrates normalized histograms for a compressed image;

[0030]FIG. 6 illustrates the difference between FIGS. 5 and 6;

[0031]FIG. 7 illustrates pixel selection for a second embodiment of thepresent invention; and

[0032]FIG. 8 illustrates pixel selection for a third embodiment of thepresent invention.

DETAILED DESCRIPTION OF THE DRAWINGS

[0033] With reference initially to FIG. 2, it will be appreciated thepresent invention may conveniently be included in a workstation orpersonal computer generally indicated as 60, operating in accordancewith a program implementing the method described herein. Conveniently,compressed images are received at personal computer 60 from atransmission line 62, via modem 64. Image received and decompressed maybe reproduced at a display 66 associated with workstation 60; at aprinter 68 with or without further processing by the workstation atmemory associated with the personal computer; or for re-transmission asan uncompressed image.

[0034] As discussed above, some image formats, which involve JPEGcompression, inflict degradation to the image. An example of thisdegradation is the formation of structure in the image that resembles anunderlying grid within the image. This grid formation can be verydistracting in the rendered image. Furthermore, sharp edges such asthose present in images containing text and graphics may also besmoothed and distorted by JPEG compression. Thus, when printing thecompressed incoming image, the image may require special processing toremove these artifacts. For example, in some printers the image mayundergo sigma filtering processing to eliminate compression artifacts.

[0035] First, however, the printing system has to determine whether theincoming uncompressed image was compressed beforehand. The preferredembodiment of the present invention proposes to identify whether theimage was JPEG compressed in the past based on the analysis of subtleblocking discontinuities.

[0036] In JPEG, the image is divided into blocks that are transformed,quantized, and compressed virtually independently. Thus, discontinuitiesacross block boundaries (blocking effects) account for the mostnoticeable compression artifact caused by JPEG compression. The higherthe compression ratio, the greater the impact of the blocking effects ison the rendered image.

[0037] As noted before, to eliminate these artifacts, the printingsystem needs an effective way to recognize a compressed or blockedimage. The present invention performs an analysis of the blockingdiscontinuities as an indicative of compression history. It is notedthat previously compressed images have more discontinuities across theborders of the 8×8 blocks than images that were not compressed.

[0038] Given this fact, a preferred embodiment of the present inventionutilizes a method as illustrates in FIG. 3. In FIG. 3, step S1 computesthe absolute difference between two neighbor pixels, for all pixels,horizontally and vertically. At step S2, the present invention dividesthe result into differences that cross the block boundaries (I) andthose that do not cross the block boundaries (II). At Step S3, thepresent invention computes the histogram of samples in I and II, andthen step S4 normalizes each histogram such that their sum is 1. At stepS5, the present invention analyzes the difference between the twonormalized histograms.

[0039]FIG. 4 depicts a normalized histogram for an area I (acrossboundaries) and for an area II (internal to a block) for an uncompressedimage. FIG. 5 depicts a normalized histogram for an area I (acrossboundaries) and for an area II (internal to a block) for the same imageafter compressing using quality factor 75 in standard JPEG. This qualityfactor maintains excellent image quality and yields only modestcompression ratios, in this case 5.6-to-1.

[0040]FIGS. 5 and 6 illustrate a large shift of the histograms due tothe compression. First the internal differences are flattened as one cansee from the fact that the number of very small differences increased.At the same time the differences across the block boundaries seemed toincrease.

[0041]FIG. 6 shows the difference between the histograms in FIGS. 5 and6 illustrating the large increase in the difference between regions Iand II after the image is compressed.

[0042] One preferred embodiment of the present invention to realize thedetection of the compressed image is to take the sum of the absolutedifferences between normalized histogram in regions I and II, i.e.K=sum(abs(norm_hist_I(0:50)−norm_hist_II(0:50))). Only the first 50elements of the histogram are included because the neighbor-pixeldifferences are very unlikely to be that high even after compression andthe histogram entries are virtually zero beyond this point. In otherwords, the remaining noisy histogram samples would not contribute to apositive identification.

[0043] The resulting number K can be compared to a predeterminedthreshold value for hard decision. This hard decision threshold can beestablished through experimentation of user choice since the thresholdonly effects the turning ON or OFF of the special processing operationwhich affects the image output, a very subjective decision based on theuser's personal tastes. On the other hand, the resulting number K can bemapped to confidence numbers for a soft decision.

[0044] In one embodiment of the present invention, the method utilizesthe following parameters or thresholds:

[0045] A. The image is unlikely to have been compressed if K<=0.05

[0046] B. The image is likely to have been compressed if 0.05<K<0.15

[0047] C. The image is very likely to have been compressed if K>=0.15

[0048] In order to find the correct position of the grid of 8×8 blocks(in case the image was previously cropped from another one) one mustfirst decide where the grid lies before using the detection methoddescribed above.

[0049] The present invention finds the correct position of the grids bycomputing the sum of absolute values of the differences in one directioncomprising only samples which are 8 pixels apart and by looking forlarger appearance of blocking artifacts. Then the process is repeatedfor the other direction; i.e., $\begin{matrix}{E_{H} = {\sum\limits_{i}{\sum\limits_{j}{{{P\left( {i,{{8j} + D_{H}}} \right)} - {P\left( {i,{{8j} + D_{H} - 1}} \right)}}}}}} \\{E_{H} = {\sum\limits_{i}{\sum\limits_{j}{{{P\left( {{{8i} + D_{V}},j} \right)} - {P\left( {{{8i} + D_{V} - 1},j} \right)}}}}}}\end{matrix}$

[0050] D_(V) and D_(H) are selected as the values for which E_(V) andE_(H) were larger, respectively.

[0051] In this process, the block grid in the image is assumed to beshifted by D_(V)x D_(H) pixels from the origin. Note that the differenceevaluation just needs to be done once while the results can be appliedfor both the energy and histogram computations.

[0052] It is evident for those skilled in the art that the presentinvention can be practiced to a subset of the image pixels. Said subsetcan correspond to a portion of the image or to a number of non adjacentpairs of pixels chosen from the image according to any reasonablecriterion.

[0053] The method was tested on several images. The results are shown inTable I for 10 monochrome images, wherein QXX indicates a quality factorof XX using the example (default) JPEG quantizer tables and a scaling(quality) factor as practiced by the Independent JPEG Group's JPEGcompression software. Q100 represents nearly perfect image (minimumquantization) but yielding very low compression, giving a reconstructedimage that is indistinguishable from the original image since thissetting achieves the best quality JPEG can provide. Q90 has invisibleartifacts and its quality is excellent for all applications achievingcompression ratios typically lower than 5:1. Quality factors of 50 andbelow are more likely scenarios where any artifact removal processingmight take place. TABLE I Values of K Im- age Original Q100 Q90 Q70 Q50Q30 Q10 1 0.0442 0.0470 0.0871 0.2437 0.3211 0.4712 0.6552 2 0.05130.0474 0.1141 0.2268 0.3185 0.4378 0.6047 3 0.0164 0.0173 0.1642 0.26780.3860 0.4045 0.4553 4 0.0393 0.0399 0.1984 0.3200 0.3984 0.4340 0.52245 0.0359 0.0402 0.1561 0.3098 0.4363 0.5663 0.7479 6 0.0312 0.03030.0508 0.1468 0.1936 0.2508 0.4039 7 0.0382 0.0387 0.1638 0.3411 0.45400.5767 0.6520 8 0.0415 0.0434 0.1226 0.1975 0.2795 0.3654 0.4847 90.0397 0.0199 0.3282 0.4155 0.3424 0.3019 0.3096 10 0.0215 0.0212 0.05290.1387 0.1671 0.2424 0.4656

[0054] Other mapping methods can be used to interpret K; e.g., mapping Kranging from 0.01 to 0.6 to a scale from 0 too 100 to indicate thelikelihood that the image was compressed using JPEG.

[0055] In another embodiment of the present invention, it takes about 6additions per block of 8×8 pixels and simple histogram manipulation todetect whether the image was previously compressed or not. Theperformance of this method is comparable to the one described above buthas a lower implementation cost.

[0056] As noted before, the above described method (FIG. 3) analyzes thehistograms of the differences between neighbor samples that cross blockboundaries against differences between samples that do not cross blockboundaries. In the second embodiment of the present invention, themethod still performs an analysis of the blocking discontinuities as anindicative of compression history since a previously compressed imagehas more discontinuities across the borders of the 8×8 blocks than animage that was not compressed.

[0057] An example of the detection method according to the secondembodiment is illustrated in FIG. 7. In FIG. 7, an 8×8 block of an imageis illustrated. Referring to FIG. 7, the second embodiment utilizes 5steps. The first step, for each block, computes Q=|A−B−C+D| and Q′=|A′31B′−C′+D′|, actually forming a sequence of measures Q(i,j) and Q′(i,j)(one sample per block). The second step computes histograms H(n) of allQ(i,j) and H′(n) of all Q′(i,j). Next, the histograms are normalized sothat the sum of entries in each one is unity. The sum of absolute valueof the histogram difference is calculated as:$E = {\sum\limits_{n = 0}^{50}{{{H(n)} - {H^{'}(n)}}}}$

[0058] Lastly, the value E is mapped to a subjective or objectiveindication value, as discussed above.

[0059] The same images from Table 1 above were used with this secondembodiment to verify how E behaves as a function of compression. Theresults are shown in Table 2 below. TABLE 2 Values of E Im- age OriginalQ100 Q90 Q70 Q50 Q30 Q10 1 0.0779 0.0889 0.3998 0.7072 0.7982 0.90581.1212 2 0.1106 0.1131 0.4732 0.6795 0.7581 0.8597 1.1073 3 0.04840.0468 0.5243 0.6330 0.7351 0.7863 0.8758 4 0.2279 0.2258 0.6171 0.68780.8085 0.7555 0.7971 5 0.0266 0.0315 0.5943 0.9024 1.0789 1.2194 1.24096 0.0506 0.0496 0.1855 0.4167 0.5106 0.5868 0.8100 7 0.0844 0.06780.6359 0.9514 1.0343 1.1013 1.1232 8 0.0967 0.1071 0.3341 0.5213 0.71330.7921 0.8987 9 0.0355 0.0897 0.6339 0.6844 0.5876 0.5434 0.5790 100.1169 0.0978 0.1794 0.3527 0.4689 0.5820 0.8743

[0060] From this verification, the parameters for E should be asfollows:

[0061] E<0.3 Not compressed at very high quality

[0062] 0.3≦E≦0.5 Likely compressed

[0063] E>0.5 Very likely compressed

[0064] A third embodiment of this detection process is illustrated byFIG. 8. This embodiment uses a reference difference inside the block.With reference to FIG. 8, the method initially, for each block, computesQ₀=|A−B−C+D|, Q₁=|W−X−Y+Z|, and Q′=A′−B′−C′+D′|, actually forming asequence of measures Q₀ (i,j), Q₁ (i,j) and Q′(i,j) (one sample perblock). Next, the method computes histograms H₀(n) of all Q₀(i,j), H₁(n)of all Q₁(i,j), and H′(n) of all Q′(i,j). The histograms are normalizedso that the sum of entries in each one is unity, and the sum of absolutevalue of the histogram differences is calculated as:$E_{0} = {\sum\limits_{n = 0}^{50}{{{{H(n)} - {H^{'}(n)}}}\quad E_{1}{\sum\limits_{n = 0}^{50}{{{H_{0}(n)} - {H_{1}(n)}}}}}}$

[0065] Lastly, the ratio E₀/E₁ is mapped to a subjective or objectiveindication value, in the same manner as discussed above. In thisembodiment, a threshold of 3 or 4 (e.g. E₀/E₁>3) is a reliable indicatorfor detecting a compressed image. This variation is more robust than thesecond embodiment, although requiring a little more computation. Othermapping methods can be used to interpret E; e.g., mapping E to acontinuous confidence number. It is noted that E is only an indicator ofblockiness in the image, therefore, one needs to be very careful to notuse E to determine how much compression was applied to an image. Lastly,the position of the 8×8 block grid can be either assumed or detected.

[0066] It is evident for those skilled in the art that the presentinvention can be practiced to a subset of the image pixels. Said subsetcan correspond to a portion of the image or to a number of non adjacentpairs of pixels chosen from the image according to any reasonablecriterion.

[0067] The disclosed methods may be readily implemented in software.Alternatively, the disclosed methods may be implemented partially orfully implemented in hardware using standard logic circuits orspecifically on a single chip using VLSI. Whether software or hardwareis used to implement the method varies depending on the speed andefficiency requirements of the system and also the particular functionand the particular software or hardware systems and the particularmicroprocessor or microcomputer systems being utilized.

[0068] While this invention has been described in conjunction with apreferred embodiment thereof, it is evident that many alternatives,modifications, and variations will be apparent to those skilled in theart. Accordingly, it is intended to embrace all such alternatives,modifications, and variations as fall within the spirit and broad scopeof the appended claims.

What is claimed is:
 1. A method for detecting if an image is compressed,comprising the steps of: (a) computing the absolute difference betweentwo neighbor pixels of an image, for a predetermined number of pixels ofthe image, horizontally and vertically; (b) dividing the results of saidstep (a) into first differences that correspond to crossing blockboundaries (I) and second differences that correspond to not crossingblock boundaries (II); (c) computing histograms from samples in I andII; (d) normalizing each histogram; and (e) determining if the image iscompressed based on a difference between the two normalized histograms.2. The method as claimed in claim 1, wherein said step (e) furthercomprises the substeps of: (e1) determining a difference value K whichis equal to K=sum(absolute((histogram (I))−(histogram(II)))); (e2)determining that the image is compressed when K is greater than a firstpredetermined threshold.
 3. The method as claimed in claim 1, whereinsaid step (e) further comprises the substeps of: (e1) determining adifference value K which is equal to K=sum(absolute((histogram(I))−(histogram(II)))); (e2) determining that the image is likelycompressed when K is greater than a first predetermined threshold andless than a second predetermined threshold.
 4. The method as claimed inclaim 1, wherein said step (e) further comprises the substeps of: (e1)determining a difference value K which is equal toK=sum(absolute((histogram (I))−(histogram(II)))); (e2) determining thatthe image is not compressed when K is less than a first predeterminedthreshold.
 5. The method as claimed in claim 2, wherein said step (e)further comprises the substep of: (e3) determining that the image islikely compressed when K is greater than a second predeterminedthreshold and less than a third predetermined threshold.
 6. The methodas claimed in claim 2, wherein said step (e) further comprises thesubstep of: (e3) determining that the image is not compressed when K isless than a second predetermined threshold.
 7. The method as claimed inclaim 3, wherein said step (e) further comprises the substep of: (e3)determining that the image is not compressed when K is less than a thirdpredetermined threshold.
 8. The method as claimed in claim 5, whereinsaid step (e) further comprises the substep of: (e4) determining thatthe image is not compressed when K is less than a fourth predeterminedthreshold.
 9. The method as claimed in claim 2, wherein the firstpredetermined value is equal to 0.15.
 10. The method as claimed in claim3, wherein the first predetermined value is equal to 0.05 and the secondpredetermined value is 0.15.
 11. The method as claimed in claim 4,wherein the first predetermined value is equal to 0.05.
 12. A method fordetecting if an image is compressed, comprising the steps of: (a)determining a block grid within the image; (b) establishing blocks fromthe determined grid; (c) computing differences between samples insidethe established blocks; (d) computing differences between samples acrossthe established blocks; and (e) determining that the image is compressedbased on characteristics derived from statistics of the computeddifferences.
 13. The method as claimed in claim 12, wherein said step(e) comprises the substeps of: (e1) computing histograms from samplesderived from said steps (c) and (d); (e2) normalizing each histogram;and (e3) determining if the image is compressed based on a differencebetween the two normalized histograms.
 14. The method as claimed inclaim 13, wherein said step (e3) further comprises the substeps of:(e3i) determining a difference value K which is equal toK=sum(absolute((histogram (I))−(histogram(II)))); (e3ii) determiningthat the image is compressed when K is greater than a firstpredetermined threshold.
 15. The method as claimed in claim 13, whereinsaid step (e3) further comprises the substeps of: (e3i) determining adifference value K which is equal to K=sum(absolute((histogram(I))−(histogram(II)))); (e3ii) determining that the image is likelycompressed when K is greater than a first predetermined threshold andless than a second predetermined threshold.
 16. The method as claimed inclaim 13, wherein said step (e3) further comprises the substeps of:(e3i) determining a difference value K which is equal toK=sum(absolute((histogram (I))−(histogram(II)))); (e3ii) determiningthat the image is not compressed when K is less than a firstpredetermined threshold.
 17. The method as claimed in claim 14, whereinsaid step (e3) further comprises the substep of: (e3iii) determiningthat the image is likely compressed when K is greater than a secondpredetermined threshold and less than a third predetermined threshold.18. The method as claimed in claim 14, wherein said step (e3) furthercomprises the substep of: (e3iii) determining that the image is notcompressed when K is less than a second predetermined threshold.
 19. Themethod as claimed in claim 15, wherein said step (e3) further comprisesthe substep of: (e3iii) determining that the image is not compressedwhen K is less than a third predetermined threshold.
 20. The method asclaimed in claim 17, wherein said step (e3) further comprises thesubstep of: (e3iv) determining that the image is not compressed when Kis less than a fourth predetermined threshold.
 21. The method as claimedin claim 13, wherein the first predetermined value is equal to 0.15. 22.The method as claimed in claim 14, wherein the first predetermined valueis equal to 0.05 and the second predetermined value is 0.15.
 23. Themethod as claimed in claim 15, wherein the first predetermined value isequal to 0.05.
 24. A method for detecting if an image is compressed,comprising the steps of: (a) computing the absolute difference betweentwo neighbor pixels of an image, for a predetermined number of pixels ofthe image, horizontally and vertically; (b) dividing the results of saidstep (a) into first differences that correspond to crossing blockboundaries (I) and second differences that correspond to not crossingblock boundaries (II); (c) determining if the image is compressed basedon a difference between statistics of the first and second differencesequences.
 25. A method to detect if an image is compressed comprisingthe steps of: (a) detecting blocking artifacts in the image indicativeof compression; and (b) providing an output indicative of compressionupon detection of the blocking artifacts.
 26. The method as claimed inclaim 1, wherein the predetermined number of pixels is all of the pixelsof the image.
 27. The method as claimed in claim 24, wherein thepredetermined number of pixels is all of the pixels of the image. 28.The method as claimed in claim 1, wherein the predetermined number ofpixels is a subsample of the pixels of the image.
 29. The method asclaimed in claim 24, wherein the predetermined number of pixels is asubsample of the pixels of the image.